Systray.dll
Narusegawa-Naru
Systray.dll allows users to create icons in the Notification area of
the windows taskbar. You can create icons for the dialogs and @windows of your
script. Since the creation and usage is independant of any interface an icon can
be created for any purpose. In other words you do not need to asociate an icon
with any particular window or dialog.The dll works by relaying mouse events from
the icon to an alias in mIRC(r) that you specify at the time of creation. You
can create up to 100 icons (like anyone would ever need that many). You can
control wich icon to be displayed,change the tooltip text,or even use windows
shell32.dll for icons. Following is a list of commands.
Event handling for the dll is in the format "Event ID" and is called from the
alias you set at the time of creation. For example if the alias you choose is
MyTray then in alias MyTray { the $1 parameter will be the event and $2 is the
ID of the icon the event occured over. The dll reports the following events to
mIRC(r) when a mouse event occurs in its bounding rectangle.
- lsclick - User single left clicked the icon
- ldclick - User double left clicked the icon
- rsclick - User single right clicked the icon
- rdclick - User double right clicked the icon
COMMANDS
- DoTray - Creates an icon
- SetTip - Changes an icons Tooltip text.
- SetIcon - Changes the icon
- LoadShell - uses icons from windows shell32.dll
- Delete - Removes an icon from the Notification area
- Info - Returns info on a certain icon.
- DllInfo - Info about the dialog.
Do Tray
Syntax:
dll
systray.dll
Do Tray
(
aliasname
) (
ID
) > (
index,Icon file
) > (
Tooltip text
)
Example:
dll
systray.dll Do Tray MyIcon 50 > 5,c:\mirc\myicon.icl > This is a tooltip
Return values:
If the function succeds the dll will call the alias specified by aliasname
with Icon created as the $1- parameter and an icon will be placed in the
Tray. If the function fails due to a bad icon file a default one will be
loaded. This is usually because windows couldnt locate the filename. Any
other errors will be returned in a call to $dll()
Remarks:
You can specify either an .ico .icl .exe or .dll file for the icon name. You can
also specify an index for icon library files (some dll files as well as icl
files contain multiple icons).
SetTip
Syntax:
dll
systray.dll
SetTip
(
ID
) > (
New text
)
Example:
dll
systray.dll SetTip 50 > Now playing somefile.mp3
Return Values:
If the function succedes the alias is called with TipTxt_Change as $1 and $2 is
the new tooltip txt. If an error occurs $dll() will yield the reason. The
function can fail if the New text portion is ommitted.
Remarks:
Icon tooltips are limited to 64 characters in length and will be truncated if
longer.
SetIcon
Syntax:
dll
systray.dll
SetIcon
(
ID
) > (
index,icon file
)
Example:
dll
systray.dll SetIcon 50 > 10,c:\new icon.icl
Return Values:
This function is subject to the same errors as DoTray with the excption of ID.
If the value given for ID represents an icon that does not exist either because
it was deleted or never created $dll() returns and Error Invalid ID. If
succesful the icon will be changed and Icon_Change is $1 in the alias with the
new icon file as $2-.
LoadShell
Syntax:
dll
systray.dll
LoadShell
(
ID
) > (
index
)
Example:
dll
systray.dll LoadShell 50 > 10
Return Values:
Upon success the icon will be changed to the index'th icon in shell32.dll. The
alias returns Icon_Change and the location of shell32 as $1 and $2- parameters.
If an error occurs $dll() will contain the reason. This function fails for the
same reason as SetIcon except that for filename it only fails if the dll cant
locate shell32.dll. However it can fail if you specify an index that is out of
range. Using an index of -1 or 2000 will return
"Error index out of range"
Visibility
Syntax:
dll
systray.dll
Visibility
(Handle) (State)
Example:
dll
systray.dll Visibility $dialog(
Tray
).hwnd Hide
Return Values:
This function does not return a value
Remarks:
If successful the window represented by Handle will be hidden (or made visible).
If State is set to Hide the window is hidden. Set State to Show to return the
window to its original state. This effectively removes a desktop window or dialog
from the taskbar and can be used to simulate minimizing to the Notification area.
Balloon New!
Sytanx:
dll
systray.dll
Balloon
(
ID
)
(
Icon#
) >
(
Topic_Text
) >
(
ToolTip_Text
)
Example:
dll
systray.dll Balloon 50 1 > Notice from $nick > $1-
Return Values:
Instructs the icon to produce a balloon style tooltip. the topic_text is in Boldface centered at the top and tooltip_text is in
the balloon itself. the text will auto wrap and can have up to 255 characters. Icon# is one of the following
1 - an Warning icon (Yellow triangle with !)
2 - an error icon (red circle wiht a X)
3 - an info icon (white circle with a !)
The balloon displays this icon in the upper left corner (like a window titlebar icon) and a close button (X) on the upper right.
if a user clicks the close button or waits for the balloon to timeout (and close itself) it returns Balloon_Timeout ID to the alias
named in the DoTray command. If a user clicks the balloon it returns Balloon_Clicked ID to the alias.
Delete
Sytanx:
dll
systray.dll
Delete
(
ID
)
Example:
dll
systray.dll Delete 50
Return Values:
If succesful the icon is deleted and only $dll() will return "OK Icon Deleted".
If an error occurs $dll() holds the error message. An error can occur if an ID
was specified that does not exist. The error message is
"Error Invalid ID"
Info
Syntax:
dll
systray.dll
Info
(
ID
)
Example:
dll
systray.dll Info 50
Return Values:
If successful the alias is called with a comma "," seperated list of values
specifying the current values for the ID. The format is "ID (id),Alias
(aliasname),Icon (icon file),Tooltip (tooltip text). As with the Delete command
an invalid id will cause this function to fail with an "Error Invalid ID"
error message.
DllInfo
Syntax:
dll
systray.dll
DllInfo
.
Return Value:
Returns the dll's current version and My infomation.
For help you can visit #Gensctipts on Irc.WonderingRaven.net or email me at
spark_chaser_@hotmail.com